from django.db import models
from fuguang.utils.models import BaseModel
# Create your models here.

class NavModel(BaseModel):
    POSITION_CHOICES = {
        (0, '顶部导航'),
        (1, '底部导航'),
    }
    link = models.CharField(max_length=20, verbose_name='导航链接')
    is_http = models.BooleanField(default=False, verbose_name='是否是外部链接')
    position = models.IntegerField(choices=POSITION_CHOICES,default=0)
    class Meta:
        db_table = 'fg_nav'
        verbose_name_plural = '导航管理'


class BannerModel(BaseModel):
    image = models.ImageField(upload_to='banner/%Y/', verbose_name='图片地址')
    link = models.CharField(max_length=255, verbose_name='轮播点击连接')
    note = models.CharField(max_length=200, null=True, verbose_name='备注信息')
    is_http = models.BooleanField(default=False, verbose_name='是否是外部链接')
    class Meta:
        db_table = 'fg_banner'
        verbose_name_plural = '轮播广告图'